package com.bdqn.demo.utils;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Result {

    private boolean success;
    private String mes;
    private String errorMes;
    private Object data;

    public static Result ok(String mes) {
        return new Result(true, mes, null, null);
    }

    public static Result ok(String mes, Object data) {
        return new Result(true, mes, null, data);
    }

    public static Result fail(String errorMes) {
        return new Result(false, null, errorMes, null);
    }

    public static Result fail(String errorMes, Object data) {
        return new Result(true, null, errorMes, data);
    }


}
